{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">提现列表</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">

    {{# if(d.status==0){ }}
    <a class="layui-btn layui-btn-xs" data-open='{:url("edit")}?id={{ d.id }}' data-title="审核">审核</a>
    {{# } }}

    {{# if(d.status==1&&d.is_kuan==0){ }}
    <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('ckuan')}','确认转账吗？')" class="layui-btn layui-btn-xs layui-btn-normal" title="确认转账">确认转账</a>
    {{# } }}


    {{# if(d.status==1){ }}
    <a class="layui-btn layui-btn-xs layui-btn-warm" data-open='{:url("detail")}?id={{ d.id }}'
       data-title="查看详情">查看详情</a>
    {{# } }}
</script>

<script type="text/html" id="picTpl">

    <img style="max-Width:80px; max-height:30px;" src="{{d.avatarUrl}}" data-image="{{d.nickname}}">

</script>

{/block}
{block name="script"}
<script>
    layui.use(['yznTable', 'table'], function () {
        var table = layui.yznTable;
        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: "{:url('add')}",
            edit_url: "{:url('edit')}",
            delete_url: "{:url('del')}",
        };
        table.render({
            elem: '#currentTable',
            autoWidth: true,
            toolbar: ['refresh',],
            url: '{:url("index")}?status={$status}',
            init: init,
            cols: [
                [
                    // {type: 'checkbox', fixed: 'left'},
                    {field: 'id', align: 'center', width: '8%', title: 'ID'},
                    {field: 'nickname', align: 'center', width: '10%', title: '用户名称'},
                    {field: 'avatarUrl', width: '8%', align: "center",title: '图片', search: false, templet: '#picTpl'},
                    {field: 'mobile', align: 'center', width: '10%', title: '联系电话', search: false},
                    {field: 'num', align: 'center', width: '10%', title: '积分数量', search: false},
                    {field: 'moeny', align: 'center', width: '10%', title: '提现金额', search: false},
                    {field: 'tixian_bank', align: 'center', width: '10%', title: '银行', search: false},
                    {field: 'tixian_name', align: 'center', width: '10%', title: '提现人', search: false},
                    {field: 'tixian_account', align: 'center', width: '10%', title: '银行账号', search: false},
                    {
                        field: 'status', align: 'center', width: '10%', title: '审核状态', templet: function (d) {
                            if (d.status == 1) {
                                return '<span style="color: green">审核通过</span>';
                            } else {
                                return '<span style="color: red">待审核</span>';
                            }
                        }, selectList: {0: '待审核', 1: '审核通过'}
                    },
                    {
                        field: 'is_kuan', align: "center", width: '8%', title: '转账状态', templet: function (d) {
                            if (d.is_kuan == 0) {
                                return '<span style="color: red">未转账</span>';
                            } else if (d.is_kuan == 1) {
                                return '<span style="color: green">转账完成</span>';
                            } else {
                                return '<span>未知</span>';
                            }
                        }, selectList: {0: '未转账', 1: '转账完成'}
                    },
                    {field: 'create_time', align: 'center', width: '15%', title: '提现时间', search: 'range'},
                    {field: 'status_time', align: 'center', width: '15%', title: '审核通过时间', search: 'range'},
                    {field: 'kuan_time', align: 'center', width: '15%', title: '转账时间', search: 'range'},
                    {fixed: 'right', align: 'center', width: '15%', title: '操作', toolbar: '#barTool'}//delete'
                ]
            ],
            page: {}
        });
        table.bindevent();
        selectElement2 = document.getElementById('searchFieldset_currentTable');
        selectElement2.classList.remove("layui-hide");
        var element = document.getElementById('layui-input-search');
        element.parentNode.removeChild(element);
    });
</script>
{/block}